package lormi.meipin.controller.api;

import lormi.meipin.common.Result;
import lormi.meipin.controller.BaseController;
import lormi.meipin.exception.LMException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * 意见反馈
 * */
@RestController
@RequestMapping(value="v2/feedback/",method=RequestMethod.POST,produces = "application/json; charset=utf-8")
public class FeedBackController extends BaseController{

	/**
	 * 意见反馈
	 * @Param userid 用户ID
	 * @Param usertype 用户类型
	 * @Param content 用户反馈信息内容
	 * */
	@RequestMapping("add")
	@Valid 
	public String addFeedback(@NotNull(message="100033") @RequestParam(value="userid",required=false)Integer userid,
			@NotNull(message="100033") @RequestParam(value="content",required=false) String content) throws LMException{
		
		feedBackService.addFeedBack(userid, content);
		
		return Result.success();
	}
	
	
}
